﻿using System;
using System.ComponentModel;
using Loki;
using Loki.UI;
using Luna.Model;

namespace Luna.UI.Project
{
    public class DisplayableTask : Displayable<LunaModel>
    {
        #region  ID
        private static PropertyChangedEventArgs _IDChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.ID);

        private Guid _ID;

        public Guid ID
        {
            get
            {
                return _ID;
            }

            set
            {
                if (value != _ID)
                {
                    _ID = value;
                    NotifyChangedAndDirty(_IDChangeArgs);
                }
            }
        }
        #endregion

        #region  Code
        private static PropertyChangedEventArgs _CodeChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.Code);

        private string _Code;

        public string Code
        {
            get
            {
                return _Code;
            }

            set
            {
                if (value != _Code)
                {
                    _Code = value;
                    NotifyChangedAndDirty(_CodeChangeArgs);
                }
            }
        }
        #endregion

        #region  Name
        private static PropertyChangedEventArgs _NameChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.Name);

        private string _Name;

        public string Name
        {
            get
            {
                return _Name;
            }

            set
            {
                if (value != _Name)
                {
                    _Name = value;
                    NotifyChangedAndDirty(_NameChangeArgs);
                }
            }
        }
        #endregion

        #region  Budget
        private static PropertyChangedEventArgs _BudgetChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.Budget);

        private decimal? _Budget;

        public decimal? Budget
        {
            get
            {
                return _Budget;
            }

            set
            {
                if (value != _Budget)
                {
                    _Budget = value;
                    NotifyChangedAndDirty(_BudgetChangeArgs);
                }
            }
        }
        #endregion

        #region  StartDate
        private static PropertyChangedEventArgs _StartDateChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.StartDate);

        private DateTime? _StartDate;

        public DateTime? StartDate
        {
            get
            {
                return _StartDate;
            }

            set
            {
                if (value != _StartDate)
                {
                    _StartDate = value;
                    NotifyChangedAndDirty(_StartDateChangeArgs);
                }
            }
        }
        #endregion

        #region  EndDate
        private static PropertyChangedEventArgs _EndDateChangeArgs = ObservableHelper.CreateArgs<DisplayableTask>(x => x.EndDate);

        private DateTime? _EndDate;

        public DateTime? EndDate
        {
            get
            {
                return _EndDate;
            }

            set
            {
                if (value != _EndDate)
                {
                    _EndDate = value;
                    NotifyChangedAndDirty(_EndDateChangeArgs);
                }
            }
        }
        #endregion
    }
}
